package main

import (
    "log"
    "golang.org/x/net/context"
    "google.golang.org/grpc"

    pb "git.edaijia-inc.cn/edaijia/ego/efree_demo/proto"
)

const (
    address     = "192.168.1.230:80"
)

func main() {
    // Set up a connection to the server.
    conn, err := grpc.Dial(address, grpc.WithInsecure())
    if err != nil {
        log.Fatalf("did not connect: %v", err)
    }
    defer conn.Close()
    c := pb.NewEfreeDemoClient(conn)

    // Contact the server and print out its response.
    r, err := c.Demo(context.Background(), &pb.DemoReq{Params: "hello"})
    if err != nil {
        log.Fatalf("could not greet: %v", err)
    }
    log.Printf("####### get server Greeting response: %s", r.Message)
}
